package icu.lookyousmileface.boot_ts_docker;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author starrysky
 * <div>用于测试Docker的构建与发布</div>
 */
@SpringBootApplication
public class BootTsDockerApplication {

    public static void main(String[] args) {
        SpringApplication.run(BootTsDockerApplication.class, args);
    }


    @RestController
    class IndexController{

        @Autowired
        RedisTemplate redisTemplate;

        @GetMapping({"/","/index"})
        public String redisStr(){
            Long views = redisTemplate.opsForValue().increment("views");
            return "You Come number is "+views;
        }
    }

}